import axios from 'axios'
import {URL} from '../utils/url'
import request from '../utils/request'

//获取评论
export function getCommentList(vid,page,pageSize){
    const url = URL + 'api/getComment'
    const data ={
      'vid': vid,
      'page':page,
      'page_size':pageSize
    }
    return axios.get(url,{
      params: data
    }).then(res => {
      return Promise.resolve(res)
    })
}

//评论回复
export function release({vid,text,lastId,replyUid,replyName}){
  return request.post('comment',{vid,text,lastId,replyUid,replyName})
}

//删除评论
export function deleteComment({id}){
  return request.post('comment/delete',{id})
}
